<template>
  <div id="app" name="app">
    <el-container>
      <!-- 顶部导航栏 -->
      <div class="topbar">
        <div class="nav">
          <ul>
            <li>
              <el-button type="text" @click="login = true">登录</el-button>
            </li>
            <li>
              <router-link to="">我的订单</router-link>
            </li>
            <li>
              <router-link to="">我的收藏</router-link>
            </li>
            <li class="shopCart">
              <router-link to="/shoppingCar">
                <i class="iconfont icon-3 "></i>购物车
              </router-link>
            </li>
          </ul>
        </div>
      </div>
      <!-- 顶部导航栏end -->

      <!-- 顶栏 -->

      <el-header>
        <el-menu
          :default-active="activeIndex"
          class="el-menu-demo"
          mode="horizontal"
          active-text-color="#409eff"
          router
          >
          <div class="logo">
            <router-link to="/">
              <img src="./assets/img/logo.png" alt />
            </router-link>
          </div>
      
          <!-- <el-menu-item index='/'>首页</el-menu-item> -->
          <el-menu-item index='/goods'>全部商品分类</el-menu-item>
          <el-menu-item >小米手机</el-menu-item>
          <el-menu-item >Redmi手机</el-menu-item>
          <el-menu-item index='/about'>关于我们</el-menu-item>      

          <div class="search">
            <el-input placeholder="请输入内容" v-model="input3" class="input-with-select">
            <el-button slot="append" icon="el-icon-search"></el-button>
            </el-input>
          </div>         
        </el-menu>
      </el-header>



      <!-- 顶栏 END -->

       <!-- 登录模块 -->

      <!-- <MyLogin /> -->
      <el-dialog title="登陆"  width="300px" center :visible.sync="login">
            <el-form :model="Login" :rules='rules' status-icon ref="ruleForm" >
                <el-form-item prop="name">
                    <el-input refix-icon="el-icon-user-solid" type="text" placeholder="请输入账号" v-model="Login.name"></el-input>
                </el-form-item>
                <el-form-item prop="pass">
                    <el-input prefix-icon="el-icon-view" type='password' placeholder="请输入密码" v-model="Login.pass"></el-input>
                </el-form-item>
                <el-form-item>
                     <el-button size='medium' type="primary" @click="Login" style="width:100%">登陆</el-button>
                </el-form-item>
                <el-form-item>
                     <el-button size='medium'  @click="register" style="width:100%">注册</el-button>
                </el-form-item>
            </el-form>
        </el-dialog>
       <!-- 登录模块END -->

      <!-- 主要区域 -->
      <el-main>
        <keep-alive>
          <router-view />
        </keep-alive>
      </el-main>
      <!-- 主要区域END -->

      <!-- 底部 -->
      <el-footer>
        <div class="footer">
          <div class="ng-promise-box">
            <p class="text">
              <a href="#"><i class="iconfont icon-baozhang">7天无理由退换货</i></a>
              <a href="#"><i class="iconfont icon-baozhang">满99元全场免邮</i></a>
              <a style="margin-right: 0" href="#"><i class="iconfont icon-baozhang">100%品质保证</i></a>
            </p>
          </div>

          <div class="github">
            <a href="#" target="_blank">
              <i class="iconfont icon-github"></i><div class="github-but"></div>
            </a>
          </div>
          <div class="mod_help">
           
            <p class="coty">商城版权所有 &copy; 2012-2021</p>
          </div>
        </div>
      </el-footer>
      <!-- 底部END -->

    </el-container>
  </div>
  
</template>


<script>
import MyLogin from './components/MyLogin';
export default {
  // 添加自定义组件
  components: { MyLogin },
  name:"app",
  data(){
    return{
      login:false,
      Login: {
        name: "",
        pass: ""
      },
    }
  }
}
</script>


<style>
@import './assets/css/index.css';
* {
  padding: 0;
  margin: 0;
  border: 0;
  list-style: none;
}
a,a:hover{
  text-decoration: none;
}

el-header{
  padding: 0;
}
el-main{
  min-height: 300px;
  padding: 20px;
  background: rgb(133, 131, 131);
}
/* 顶部导航css */
.topbar {
  height: 50px;
  background: rgb(24, 23, 23, 0.5);

}

.topbar .nav {
  width: 85%;
  margin: auto;
}
.topbar .nav ul {
  float: right;
}

.topbar .nav li {
  float: left;
  height: 40px;
  color: #d6d5d5;
  font-size: 14px;
  text-align: center;
  line-height: 40px;
  margin-left: 12px;
}

.topbar .nav li a {
  color: #d6d5d5;
}
.topbar .nav a:hover {
  color: rgb(250, 250, 250);
}
.topbar .nav .shopCart{
  width: 100px;
  background: rgb(247, 86, 12);
  
}
.topbar .nav .shopCart i{
  margin-right: 5px;
}
.topbar .nav .shopCart a:hover {
  color: rgb(245, 243, 243);
}

/* 顶部导航css ENd */


/* 顶栏 */
.el-header .el-menu {
  max-width: 90% ;
  margin: 0 auto; 
}
.el-header .el-menu .el-menu-item {
  font-size: 15px;
  font-weight: 500;
  color: rgb(109, 107, 107)
}


.el-header .logo{
  height: 70px;
  width: 140px;
  float: left;
  margin-right: 100px;
}
.el-header .logo img{
  height: 100%;
  width: 100%;
}

.el-header .search {
  margin-top: 15px;
  width: 300px;
  float: right; 
  margin-right: 20px;

}

/* 顶栏END */

/* 底部 */
.footer{
  width: 100%;
  text-align: center;
  background: #cacaca;
  padding-bottom: 20px;
}
.footer .ng-promise-box {
  margin: 0 auto;
  border-bottom: 1px solid #f8f8f8;
  line-height: 120px;
}
.footer .ng-promise-box p a{
  color: #363535;
  /* font-size: 20px; */
  width: 15%;
  margin-right: 100px;
  height: 40%;
  display:inline-block;
  text-decoration: none;

}
.footer .ng-promise-box p a i{
  font-size: 25px;
}
.footer .github{
  height: 100px;
  line-height: 100px;
  margin: 0 auto;
  
}
.footer .github i{
  font-size: 60px;
  color: #363535;
}

.footer .mod_help{
  color: #363535;
}

/* 底部END */

</style>
